import java.sql.*;

public class y {
    public static void main(String[] args) throws SQLException {

        Connection connection = DriverManager.getConnection("jdbc:mysql://doitedu:9030/test", "root", "root");
        Statement statement = connection.createStatement();
        ResultSet rs = statement.executeQuery("select id,name from stu");
        while(rs.next()){
            System.out.println(rs.getInt(1));
            System.out.println(rs.getString(2));
        }


    }
}
